package com.whiteape.book.ui.activity;

import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;

import androidx.appcompat.widget.Toolbar;

import com.whiteape.book.R;
import com.whiteape.book.model.type.WebviewDocType;
import com.whiteape.book.ui.base.BaseActivity;

import butterknife.BindView;

public class AboutActivity extends BaseActivity implements View.OnClickListener {

    @BindView(R.id.rl_about_user_complaint)
    RelativeLayout rlComplaint;

    @BindView(R.id.rl_about_privacy)
    RelativeLayout rlPrivacy;

    @BindView(R.id.rl_about_disclaimer)
    RelativeLayout rlDisclaimer;

    @BindView(R.id.rl_about_user_support)
    RelativeLayout rlSupport;
    @Override
    protected int getContentId() {
        return R.layout.activity_about;
    }


    @Override
    protected void initEvent() {
        super.initEvent();
        rlComplaint.setOnClickListener(this);
        rlPrivacy.setOnClickListener(this);
        rlDisclaimer.setOnClickListener(this);
        rlSupport.setOnClickListener(this);
    }

    @Override
    protected void setUpToolbar(Toolbar toolbar) {
        super.setUpToolbar(toolbar);
        if (getSupportActionBar() != null) {
            getSupportActionBar().setTitle("关于");
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.rl_about_user_complaint:
                startActivity(new Intent(this, WebviewActivity.class).putExtra(WebviewActivity.KEY_WEBVIEW_TYPE, WebviewDocType.WEBVIEW_DOC_TYPE_COMPLAINT));
                break;
            case R.id.rl_about_privacy:
                startActivity(new Intent(this, WebviewActivity.class).putExtra(WebviewActivity.KEY_WEBVIEW_TYPE, WebviewDocType.WEBVIEW_DOC_TYPE_PRIVCY));
                break;
            case R.id.rl_about_disclaimer:
                startActivity(new Intent(this, WebviewActivity.class).putExtra(WebviewActivity.KEY_WEBVIEW_TYPE, WebviewDocType.WEBVIEW_DOC_TYPE_DISCLAIMER));
                break;
            case R.id.rl_about_user_support:
                startActivity(new Intent(this, WebviewActivity.class).putExtra(WebviewActivity.KEY_WEBVIEW_TYPE, WebviewDocType.WEBVIEW_DOC_TYPE_SUPPORT));
                break;

        }
    }
}
